3.65 \(\int \log ^2(a+b x) \, dx\)

Optimal. Leaf size=37 \[ \frac{(a+b x) \log ^2(a+b x)}{b}-\frac{2 (a+b x) \log (a+b x)}{b}+2 x \]

[Out]

2*x - (2*(a + b*x)*Log[a + b*x])/b + ((a + b*x)*Log[a + b*x]^2)/b

________________________________________________________________________________________

Rubi [A]  time = 0.0143306, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.375, Rules used = {2389, 2296, 2295} \[ \frac{(a+b x) \log ^2(a+b x)}{b}-\frac{2 (a+b x) \log (a+b x)}{b}+2 x \]

Antiderivative was successfully verified.

[In]

Int[Log[a + b*x]^2,x]

[Out]

2*x - (2*(a + b*x)*Log[a + b*x])/b + ((a + b*x)*Log[a + b*x]^2)/b

Rule 2389

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2296

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rubi steps

\begin{align*} \int \log ^2(a+b x) \, dx &=\frac{\operatorname{Subst}\left (\int \log ^2(x) \, dx,x,a+b x\right )}{b}\\ &=\frac{(a+b x) \log ^2(a+b x)}{b}-\frac{2 \operatorname{Subst}(\int \log (x) \, dx,x,a+b x)}{b}\\ &=2 x-\frac{2 (a+b x) \log (a+b x)}{b}+\frac{(a+b x) \log ^2(a+b x)}{b}\\ \end{align*}

Mathematica [A]  time = 0.0043415, size = 36, normalized size = 0.97 \[ \frac{(a+b x) \log ^2(a+b x)-2 (a+b x) \log (a+b x)+2 b x}{b} \]

Antiderivative was successfully verified.

[In]

Integrate[Log[a + b*x]^2,x]

[Out]

(2*b*x - 2*(a + b*x)*Log[a + b*x] + (a + b*x)*Log[a + b*x]^2)/b

________________________________________________________________________________________

Maple [A]  time = 0.059, size = 55, normalized size = 1.5 \begin{align*} \left ( \ln \left ( bx+a \right ) \right ) ^{2}x+{\frac{ \left ( \ln \left ( bx+a \right ) \right ) ^{2}a}{b}}-2\,\ln \left ( bx+a \right ) x-2\,{\frac{\ln \left ( bx+a \right ) a}{b}}+2\,x+2\,{\frac{a}{b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(b*x+a)^2,x)

[Out]

ln(b*x+a)^2*x+1/b*ln(b*x+a)^2*a-2*ln(b*x+a)*x-2/b*ln(b*x+a)*a+2*x+2*a/b

________________________________________________________________________________________

Maxima [A]  time = 1.2412, size = 36, normalized size = 0.97 \begin{align*} \frac{{\left (b x + a\right )}{\left (\log \left (b x + a\right )^{2} - 2 \, \log \left (b x + a\right ) + 2\right )}}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(b*x+a)^2,x, algorithm="maxima")

[Out]

(b*x + a)*(log(b*x + a)^2 - 2*log(b*x + a) + 2)/b

________________________________________________________________________________________

Fricas [A]  time = 1.76001, size = 88, normalized size = 2.38 \begin{align*} \frac{{\left (b x + a\right )} \log \left (b x + a\right )^{2} + 2 \, b x - 2 \,{\left (b x + a\right )} \log \left (b x + a\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(b*x+a)^2,x, algorithm="fricas")

[Out]

((b*x + a)*log(b*x + a)^2 + 2*b*x - 2*(b*x + a)*log(b*x + a))/b

________________________________________________________________________________________

Sympy [A]  time = 0.365685, size = 42, normalized size = 1.14 \begin{align*} 2 b \left (- \frac{a \log{\left (a + b x \right )}}{b^{2}} + \frac{x}{b}\right ) - 2 x \log{\left (a + b x \right )} + \frac{\left (a + b x\right ) \log{\left (a + b x \right )}^{2}}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(b*x+a)**2,x)

[Out]

2*b*(-a*log(a + b*x)/b**2 + x/b) - 2*x*log(a + b*x) + (a + b*x)*log(a + b*x)**2/b

________________________________________________________________________________________

Giac [A]  time = 1.31965, size = 59, normalized size = 1.59 \begin{align*} \frac{{\left (b x + a\right )} \log \left (b x + a\right )^{2}}{b} - \frac{2 \,{\left (b x + a\right )} \log \left (b x + a\right )}{b} + \frac{2 \,{\left (b x + a\right )}}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(b*x+a)^2,x, algorithm="giac")

[Out]

(b*x + a)*log(b*x + a)^2/b - 2*(b*x + a)*log(b*x + a)/b + 2*(b*x + a)/b